.class public Lcom/kwad/sdk/core/scene/URLPackage;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/kwad/sdk/core/b;
.implements Ljava/io/Serializable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/kwad/sdk/core/scene/URLPackage$PageSource;
    }
.end annotation


# static fields
.field public static final KEY_AUTHOR_ID:Ljava/lang/String; = "authorId"

.field public static final KEY_TUBE_ID:Ljava/lang/String; = "tubeId"

.field private static final serialVersionUID:J = -0x663890b4ee96c253L


# instance fields
.field public identity:Ljava/lang/String;

.field private transient mJsonObjectParams:Lorg/json/JSONObject;

.field public page:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

.field private params:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Lcom/kwad/sdk/core/scene/URLPackage$PageSource;)V
    .locals 0
    .param p1    # Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p2    # Lcom/kwad/sdk/core/scene/URLPackage$PageSource;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p2, p0, Lcom/kwad/sdk/core/scene/URLPackage;->page:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    iput-object p1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->identity:Ljava/lang/String;

    return-void
.end method

.method private initParams()V
    .locals 1

    iget-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->mJsonObjectParams:Lorg/json/JSONObject;

    if-nez v0, :cond_0

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iput-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->mJsonObjectParams:Lorg/json/JSONObject;

    :cond_0
    return-void
.end method


# virtual methods
.method public parseJson(Lorg/json/JSONObject;)V
    .locals 2
    .param p1    # Lorg/json/JSONObject;
        .annotation build Landroidx/annotation/Nullable;
        .end annotation
    .end param

    if-nez p1, :cond_0

    return-void

    :cond_0
    const-string v0, "page"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v0

    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->HOME:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_1

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->HOME:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    :goto_0
    iput-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->page:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_1

    :cond_1
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TREND:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_2

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TREND:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_2
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->PROFILE:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_3

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->PROFILE:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_3
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->PROFILE_VIDEO_LIST:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_4

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->PROFILE_VIDEO_LIST:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_4
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_EPISODE_LIST:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_5

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_EPISODE_LIST:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_5
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_DETAIL:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_6

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_DETAIL:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_6
    sget-object v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_PROFILE:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    invoke-virtual {v1}, Ljava/lang/Enum;->ordinal()I

    move-result v1

    if-ne v0, v1, :cond_7

    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->TUBE_PROFILE:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :cond_7
    sget-object v0, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->UNKNOWN:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    goto :goto_0

    :goto_1
    const-string v0, "identity"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->identity:Ljava/lang/String;

    const-string v0, "params"

    invoke-virtual {p1, v0}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->params:Ljava/lang/String;

    :try_start_0
    invoke-static {p1}, Lcom/kwad/sdk/c/n;->a(Ljava/lang/String;)Z

    move-result p1

    if-nez p1, :cond_8

    new-instance p1, Lorg/json/JSONObject;

    iget-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->params:Ljava/lang/String;

    invoke-direct {p1, v0}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    iput-object p1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->mJsonObjectParams:Lorg/json/JSONObject;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_8
    return-void
.end method

.method public putParams(Ljava/lang/String;J)V
    .locals 1

    invoke-direct {p0}, Lcom/kwad/sdk/core/scene/URLPackage;->initParams()V

    iget-object v0, p0, Lcom/kwad/sdk/core/scene/URLPackage;->mJsonObjectParams:Lorg/json/JSONObject;

    invoke-static {v0, p1, p2, p3}, Lcom/kwad/sdk/c/e;->a(Lorg/json/JSONObject;Ljava/lang/String;J)V

    return-void
.end method

.method public toJson()Lorg/json/JSONObject;
    .locals 3

    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0}, Lorg/json/JSONObject;-><init>()V

    iget-object v1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->page:Lcom/kwad/sdk/core/scene/URLPackage$PageSource;

    if-eqz v1, :cond_0

    iget v1, v1, Lcom/kwad/sdk/core/scene/URLPackage$PageSource;->pageScene:I

    const-string v2, "page"

    invoke-static {v0, v2, v1}, Lcom/kwad/sdk/c/e;->a(Lorg/json/JSONObject;Ljava/lang/String;I)V

    :cond_0
    iget-object v1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->identity:Ljava/lang/String;

    const-string v2, "identity"

    invoke-static {v0, v2, v1}, Lcom/kwad/sdk/c/e;->a(Lorg/json/JSONObject;Ljava/lang/String;Ljava/lang/String;)V

    iget-object v1, p0, Lcom/kwad/sdk/core/scene/URLPackage;->mJsonObjectParams:Lorg/json/JSONObject;

    if-eqz v1, :cond_1

    invoke-virtual {v1}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "params"

    invoke-static {v0, v2, v1}, Lcom/kwad/sdk/c/e;->a(Lorg/json/JSONObject;Ljava/lang/String;Ljava/lang/String;)V

    :cond_1
    return-object v0
.end method
